<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height">
    <div class="border-hover-style" style="display: flex">
      <div
        class="content-parent"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style5/Level3outlinestyle4Bg.webp'})`,
        }"
      >
        <div class="digitalShowroom-p" v-if="props.info.digitalShowroom">
          <digitalShowroomIcon :url="props.info.digitalShowroom" />
        </div>
        <div
          class="content"
          v-if="props.info.subTitle || props.info.value || props.info.remarks"
          :class="{ 
 content6: !props.info.value && props.info.subTitle && !props.info.remarks,
            content2: props.info.value && !props.info.subTitle && !props.info.remarks }"
            
        >
          <div class="title-box"  :class="{ 'title-box-sb': props.info.text.length > 8 }" v-html="textType(props.info.text)"></div>
          <div class="content-right">
            <p class="subtitle" v-if="props.info.subTitle">——{{ props.info.subTitle }}</p>
            <div
              class="img-box"
              :class="{
                'img-box1': props.info.remarks && props.info.subTitle,
                'img-box2': props.info.remarks && !props.info.subTitle,
                'img-box3': !props.info.remarks && props.info.subTitle,
                'img-box4': !props.info.remarks && !props.info.subTitle,
              }"
              v-if="props.info.value"
            >
              <div class="outline-cover">
                <img
                
                @click="ImgVisible = true"
                :src="urls + props.info.value + '?imageView2/3/format/webp'"
                alt=""
              />
              </div>
            </div>
            <div class="remarks1" v-if="props.info.value">
              <TextMax
                :color2="false"
                :infoData="props.info" 
                v-if="props.domShow"
                :data="props.info.remarks"
                :title="props.info.text"
                :row="5" 
              ></TextMax>   
            </div>
            <div class="remarks2" v-else-if="props.info.remarks">
              <TextMax 
                :color2="false"
                :infoData="props.info"
                v-if="props.domShow"
                :data="props.info.remarks" 
                :title="props.info.text"
                :row="!props.info.subTitle ? 11 : 9"
              ></TextMax>
            </div>
          </div>
        </div>
        <div class="content3" v-else>
          <div class="title-box"  :class="{ 'title-box-sb': props.info.text.length > 8 }" v-html="textType(props.info.text)"></div>
        </div>
      </div>
    </div>
  </div>
</template>  

<script lang="ts">
export default defineComponent({
  name: 'free5Style44',
});
</script>

<script setup lang="ts">
import { getRemarksNum } from '@/utils/minxin';
import digitalShowroomIcon from '@/freeComponents/unitdigitalShowroom/style5.vue';
import { publicUrls } from '@/utils/minxin';
import { getTextHtml, textType } from '@/utils/minxin';
import { urls } from '@/utils/request/upload';
import { computed, defineComponent, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/TextMax5.vue';
import { useProjectStore } from '@/store';
import { useRouter, useRoute } from 'vue-router';
const route = useRoute();
const ImgVisible = ref(false);
const store = useProjectStore();
const title = ref();

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});  
</script>

<style scoped lang="less">
.outline-parent {
  display: flex;
  align-items: flex-end;
  position: relative;
  margin-right: 140px;
  margin-left: 40px;
  margin-top: 0;
  height: 100%;
}
.content-parent {
  display: flex;
  position: relative;
  width: 460px;
  height: 684px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.digitalShowroom-p {
  position: absolute;
  top: 93px;
  left: 199px;
  width: 50px;
  height: 50px;
  z-index: 15;
}
.content {
  display: flex;

  width: 460px;

  padding-top: 158px;
  padding-left: 43px;
  padding-right: 59px;
  z-index: 6;
  position: relative;
}
.content2 {
  // .subtitle {
  //   margin-top: 32px;
  // }
}
.content6{
  .subtitle { 
    margin-top: 170px;
  }
}
.content3 {
  display: flex; 
  justify-content: center; 
  width: 460px; 
  padding-top: 158px;
  
} 
.title-box {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 50px;
  margin-top: 72px; 
  height: 224px; 
  :deep(p) { 
    width: 22px;
    font-family: SourceBold;
    font-size: 20px; 
    color: rgba(63, 95, 92, 1);
    line-height: 28px;
    text-align: center;
  }
}
.title-box-sb {
  justify-content: space-between;
}
.content-right {
  display: flex; 
  flex-direction: column;
  align-items: center;
  margin-left: 20px;
  flex: 1;
}
.subtitle {
  width: 100%; 
  font-family: SourceMedium;  
  font-size: 16px;  
  color: rgba(63, 95, 92, 1);
  line-height: 28px;
  text-align: center;
  font-weight: 400;
}
.img-box {
  position: relative;
  overflow: hidden;
  background: rgba(144, 165, 157, 0.2);
  .outline-cover {
    width: 100%;
    height: 100%;  
    object-fit: contain;
    overflow: hidden;
    img { 
      transition: all 0.3s;
      width: 100%;
      height: 100%; 
      object-fit: contain;
    }
  }
}
.img-box:hover {
  .outline-cover { 
    img { 
      transform: scale(1.2);
    }
  }
}
.img-box1 {
  display: flex;

  width: 288px;
  height: 132px;
  margin-top: 10px;
}
.img-box2 {
  width: 288px;
  height: 185px;
  margin-top: 13px;
}
.img-box3 {
  width: 288px;
  height: 277px;
  margin-top: 10px;
}
.img-box4 { 
  width: 288px; 
  height: 323px;
  margin-top: 28px;
}

.remarks1 {
  width: 288px; 
  margin-top: 10px;
  :deep(.van-text-ellipsis) {
  }
}
.remarks2 {
  width: 288px;
  margin-top: 10px;
}
</style>